package com.terana.lbs.marketing.web.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tarena.lbs.pojo.marketing.dos.CouponCodeDO;
import com.tarena.lbs.pojo.marketing.po.CouponCodePO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface CouponCodeMapper extends BaseMapper<CouponCodePO> {
    @Select("select * from coupon_code where status=0 and coupon_id=#{couponId}")
    List<CouponCodeDO> selectListByCouponId(Integer couponId);

    @Update("update coupon_code set status=1 where id=#{id}")
    void updateReceivedById(Integer id);
}
